import request from '@/utils/request'

export function fetchList(params) {
  return request({
    url: '/role/list',
    method: 'get',
    params: params
  })
}

export function allList() {
  return request({
    url: '/role/allList',
    method: 'get'
  })
}
export function getData(id) {
  return request({
    url: '/role/'+id,
    method: 'get'
  })
}

export function addData(data) {
  return request({
    url: '/role/add',
    method: 'post',
    data: data
  })
}

export function deleteData(id) {
  return request({
    url: '/role/'+id,
    method:'delete',
  })
}

export function updateData(id,data) {
  return request({
    url: '/role/' + id,
    method: 'put',
    data: data
  })
}
